#!/bin/bash

# cinder service
openstack-config --set /etc/cinder/cinder.conf oslo_messaging_notifications driver messagingv2
crontab -e

*/5 * * * * /usr/bin/cinder-volume-usage-audit --send_actions

systemctl restart openstack-cinder-api.service openstack-cinder-scheduler.service openstack-cinder-volume.service

# glance service
openstack-config --set /etc/glance/glance-api.conf DEFAULT transport_url rabbit://openstack:openstack@controller:5673
openstack-config --set /etc/glance/glance-api.conf oslo_messaging_notifications driver messagingv2
openstack-config --set /etc/glance/glance-registry.conf DEFAULT transport_url rabbit://openstack:openstack@controller:5673
openstack-config --set /etc/glance/glance-registry.conf oslo_messaging_notifications driver messagingv2

systemctl restart openstack-glance-api.service openstack-glance-registry.service

# Neutron service
openstack-config --set /etc/neutron/neutron.conf oslo_messaging_notifications driver messagingv2
systemctl restart neutron-server.service

# Orchestration service
openstack-config --set /etc/heat/heat.conf oslo_messaging_notifications driver messagingv2

systemctl restart openstack-heat-api.service openstack-heat-api-cfn.service openstack-heat-engine.service